package com.lechuang.goods.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lechuang.goods.entity.GoodsRegionSpu;
import com.lechuang.goods.service.GoodsRegionSpuService;
import com.lechuang.goods.mapper.GoodsRegionSpuMapper;
import com.lechuang.goods.vo.GoodsRegionSpuVO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author apple
* @description 针对表【goods_region_ref(区域和商品关联表)】的数据库操作Service实现
* @createDate 2024-06-24 17:37:36
*/
@Service
public class GoodsRegionSpuServiceImpl extends ServiceImpl<GoodsRegionSpuMapper, GoodsRegionSpu>
    implements GoodsRegionSpuService {

    @Resource
    private GoodsRegionSpuMapper goodsRegionSpuMapper;

    @Override
    public List<GoodsRegionSpu> getByRegionId(Long regionId) {
        return this.lambdaQuery()
                .eq(GoodsRegionSpu::getRegionId, regionId)
                .list();
    }

    @Override
    public List<GoodsRegionSpuVO> getByCategoryId(Long categoryId) {
        return goodsRegionSpuMapper.getByCategoryId(categoryId);
    }

}




